<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jq-3.6.0.js"></script>
    <style>
        .box {
            height: 100px;
            width: 100px;
            background-color: green;
            display: none;
        }
    </style>
</head>

<body>
    <button class="bn1">点击显示</button>
    <button class="bn2">点击隐藏</button>
    <button class="bn3">切换</button>
    <div class="box"></div>
</body>
<script>
    $('.bn1').click(function() {
        //slow,normal, or fast
        //linear:匀速 swing由慢->快->慢
        $('.box').show(2000, 'linear', function() {
            $(this).css({
                'backgroundColor': 'red'
            })
        })
    })
    $('.bn2').click(function() {
        //slow,normal, or fast
        //linear:匀速 swing由慢->快->慢
        $('.box').hide(2000, 'linear', function() {
            alert('猜猜我在哪')
        })
    })
    $('.bn3').click(function() {
        //slow,normal, or fast
        //linear:匀速 swing由慢->快->慢
        $('.box').toggle(2000)
    })
</script>

</html>